<?php
namespace app\model\admin\material;

use app\model\admin\basic\BasicGuide;
use laytp\BaseModel;
use think\model\Pivot;
class MaterialGroup extends BaseModel
{
    protected $name = 'material_group';

    public function guide(){
        return $this->belongsToMany(BasicGuide::class,MaterialGroupGuide::class,"guide_id","material_group_id");
    }

    public function style(){
        return $this->hasOne(MaterialStyle::class,"id","material_style_id")->bind(["style_name"=>"name"]);
    }
}